<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('Gift/index')}">所有栏目</a></li>
        <li class="active" ><a>编辑</a></li>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('Gift/edit')}">

        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>名称:</label>
            <div class="col-md-6 col-sm-10">
                <input type="hidden" name="id" value="{$id}">
                <input type="text" class="form-control" name="title" value="{$title}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">关键字:</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="keyword" value="{$keyword}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">描述:</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="desc" value="{$desc}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">介绍:</label>
            <div class="col-md-6 col-sm-10">
                <textarea name="content" id="" cols="85" rows="10">{$content}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">图片:</label>
            <div class="col-md-6 col-sm-10">
                    <input type="hidden" name="img" id="thumb" value="{$img|default=''}">
                    <a href="javascript:uploadOneImage('图片上传','#thumb');">
                        <if condition="empty($img)">
                            <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                                 id="thumb-preview" width="135" style="cursor: hand"/>
                            <else/>
                            <img src="{:cmf_get_image_preview_url($img)}" id="thumb-preview"
                                 width="135" style="cursor: hand"/>
                        </if>
                    </a>
                    <input type="button" class="btn btn-sm"
                           onclick="$('#thumb-preview').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;"
                           value="取消图片">
            </div>
        </div>
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-primary   js-ajax-submit">{:lang("SAVE")}</button>
            <a class="btn btn-default" href="{:url('Gift/index')}">返回</a>
        </div>
    </form>

</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>